package com.mysite.dubbox.comsumer.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.alibaba.dubbo.config.annotation.Reference;
import com.mysite.dubbox.facade.UserFacade;
import com.mysite.dubbox.vo.UserVo;

@Controller
public class UserController {

	@Reference(version="1.0.0")
	private UserFacade userFacade;
	
	@RequestMapping("user/{userid}")
	@ResponseBody
	public UserVo getUser(@PathVariable Long userid){
        UserVo vo  = userFacade.getUser(userid);
        System.err.println("query result is: " + vo.getName());
        return vo;
	}
}
